package Adler;

import java.rmi.Remote;
import java.rmi.RemoteException;

/// interface for inserting RDF/XML data into the Database via Adler. FIXME: 
/// In the future this will extend Remote so that external processes can call it.
public interface DataInserter extends Remote
{
  
  /// Inserts data into the specified project. The project must already exist.
  /// @param project The name of the project to insert data into. 
  /// @param semanticData The semantic data to insert into the project. This can be one of a number of 
  ///   different formats (see below)
  /// @param baseURI The base URI to use for all relative URI identifiers in the semanticData blob.
  ///   If that doesn't mean much to you, look up Model.read in the Jena documentation. 
  /// @param dataLanguage Specifies what format semanticData is passed in. Can be any of the following:
  ///   "RDF/XML", "N-TRIPLE", "N3", and 'null'. 'null' is equiv. to "RDF/XML". 
  /// @return 'SEND_OK' on success. A negative value on failure (see error codes defined in this interface). 
  int Send( String project, String semanticData, String baseURI, String dataLanguage)
            throws RemoteException;
  
  /// This method expose the ontology URL for our ontology
  String getOntology() throws RemoteException;

  static final int SEND_OK = 0;
  static final int ERR_PROJECT_BUSY = -1;         ///< Could not write to the DB as somebody else is using it. 
  static final int ERR_FORMAT_INVALID = -2;       ///< The Model couldn't parse the RDF/XML data that was sent
  static final int ERR_PROJECT_DOESNT_EXIST = -3; ///< Tried to insert data into a non-existent Project. 
}